/*
  ArtToSpr Artworks/Draw to Sprite convertor
  Copyright (c) 1998 Tony Houghton

  This source is distributed under the GPL. Please see the file
  "COPYING" for details.
*/

#ifndef __picwin_h
#define __picwin_h

#ifndef osspriteop_H
#include "osspriteop.h"
#endif

#ifndef __toolbox_h
#include "toolbox.h"
#endif

#ifndef __linklist_h
#include "linklist.h"
#endif
#ifndef __opts_h
#include "opts.h"
#endif
#ifndef __picture_h
#include "picture.h"
#endif

typedef struct {
  linklist_header node;
  options opts;
  picture pic;
  ObjectId mainwin;
  ObjectId optswin;
  bool unsaved;
  char *filename;
  int zoom;
  int width, height;
  int xeig, yeig;
  osspriteop_area *sparea;
  osspriteop_trans_tab *pixtrans;
  os_factors scale;
  bool save_discard;
} picwin;

#ifdef __cplusplus
extern "C" {
#endif

/* Registers global handlers */
extern void picwin_initialise(void);

/* Loads a picture, converts it and if savename is NULL sets up its windows
   etc, otherwise bypasses GUI and saves converted file */
extern bool picwin_load(const char *filename, const char *savename);

/* Whether any pictures are unsaved */
extern bool picwin_ok_to_quit(void);

#ifdef __cplusplus
}
#endif

#endif
